<template>
  <div id="app">
    <headerCom v-if="showHeader"> <!-- 使用 v-if 根据路由的 meta.header 判断是否显示头部 -->
      <!-- 公共头部内容 -->
    </headerCom>
    <RouterView />
  </div>
</template>
<script setup>
import headerCom from "@/components/headerCom";
import { useRoute } from "vue-router";
// import { reactive, toRefs } from "vue";
import { RouterView } from "vue-router";
// const router = useRouter();
const route = useRoute();
const showHeader = route.meta.header !== false;
</script>
<style>
html,
body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  margin: 0;
  padding: 0;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;
}

nav a {
  font-weight: bold;
  color: #2c3e50;
}

nav a.router-link-exact-active {
  color: #42b983;
}
</style>
